import request from '@/config/axios'

export interface GroupVO {
  id: number
  name: string
  thirdPartyId: string
  ownerUserId: number
}

// 查询班组分页
export const getGroupPage = async (params) => {
  return await request.get({ url: `/call/group/page`, params })
}

// 查询班组全部
export const getGroupSimpleList = async () => {
  return await request.get({ url: `/call/group/simple-list` })
}

// 查询班组详情
export const getGroup = async (id: number) => {
  return await request.get({ url: `/call/group/get?id=` + id })
}

// 新增班组
export const createGroup = async (data: GroupVO) => {
  return await request.post({ url: `/call/group/create`, data })
}

// 修改班组
export const updateGroup = async (data: GroupVO) => {
  return await request.put({ url: `/call/group/update`, data })
}

// 删除班组
export const deleteGroup = async (id: number) => {
  return await request.delete({ url: `/call/group/delete?id=` + id })
}

// 导出班组 Excel
export const exportGroup = async (params) => {
  return await request.download({ url: `/call/group/export-excel`, params })
}
